<?php

//No direct access
defined('_JEXEC') or die('Restricted access');

$priceformat = OwnserviceHelper::getParams('price_format', '#,###.##');

?>
<script language="javascript" type="text/javascript">
	<!--
		function submitbutton(pressbutton)
		{
			var form = document.adminForm;
			if(form.boxchecked.value==0){
				alert('<?php echo JText::_('OWNSERVICE_TRANSFER_SELECTION_MESSAGE'); ?>'); 
				return false;
			} else {
				submitform( pressbutton );
			}
		}
	//-->
</script>
<div id="ownservices">
	<div id="mainmenuownservice"><?php echo MenuHelper::nav(); ?></div>
	<div id="mainownservice">
		<form action="<?php echo JRoute::_('index.php'); ?>" method="post" name="adminForm">
		 <h3><?php echo JText::_('OWNSERVICE_RECEIVER_ACCOUNTS'); ?></h3>
		 <hr />
		 <table class="adminlist" cellspacing="1">
			<tr>
				<td align="center" width="10" valign="bottom" class="tablelist">
					<input type="checkbox" name="toggle" value="" onclick="checkAll(<?php echo count($this->accounts); ?>);" />
				</td>
				<td align="center" class="tablelist">
					<?php echo JHTML::_('grid.sort',  'OWNSERVICE_ACCOUNT_NO', 'a.account_no', $this->lists['order_Dir'], $this->lists['order'] ); ?>
				</td>

				<td align="center" class="tablelist">
					<?php echo JHTML::_('grid.sort',  'OWNSERVICE_ACCOUNT_NAME', 'a.account_name', $this->lists['order_Dir'], $this->lists['order'] ); ?>
				</td>
				<td align="center" class="tablelist">
					<?php echo JHTML::_('grid.sort',  'OWNSERVICE_ACCOUNT_TYPE', 'a.account_type', $this->lists['order_Dir'], $this->lists['order'] ); ?>
				</td>
				<td align="center" class="tablelist">
					<?php echo JHTML::_('grid.sort',  'OWNSERVICE_BANK_NAME', 'a.bank_name', $this->lists['order_Dir'], $this->lists['order'] ); ?>
				</td>
				<td align="center" class="tablelist">
					<?php echo JHTML::_('grid.sort',  'OWNSERVICE_BRANCH_NAME', 'a.branch_name', $this->lists['order_Dir'], $this->lists['order'] ); ?>
				</td>
			</tr>
			<?php 
				$k = 0;
				for( $i=0,$n=count($this->accounts);$i<$n;$i++ ):

				$account  	= $this->accounts[$i];

				$checked 	= JHTML::_('grid.checkedout', $account, $i ); 
			?>			
			<tr class="<?php echo "row$k"; ?>">
				<td align="center" class="inner_tablelist">
					<?php echo $checked; ?>
				</td>
				<td class="inner_tablelist">
					<?php echo OwnserviceHelper::accountFormat($account->account_no); ?>
				</td>
				<td class="inner_tablelist">
					<?php echo $account->account_name; ?>
				</td>
				<td class="inner_tablelist">
					<?php echo ucwords($account->account_type); ?>
				</td>
				<td class="inner_tablelist">
					<?php echo ucwords($account->bank_name); ?>
				</td>
				<td class="inner_tablelist">
					<?php echo ucwords($account->branch_name); ?>
				</td>
			</tr>
			<?php $k = 1 - $k; endfor; ?>
		</table>
		<div style="text-align:center; margin-top:5px;">
			<?php /*<input type="button" name="next" value="<?php echo JText::_('OWNSERVICE_CONTINUE_PROCESS'); ?>" disabled="disabled" onClick="javascript: submitbutton('transfer');" />*/ ?>
			<input type="button" name="next" value="<?php echo JText::_('OWNSERVICE_FUND_TRANSFER'); ?>" onClick="javascript: submitbutton('transfer');" />
		</div>
	<input type="hidden" name="option" value="com_ownservice" />
	<input type="hidden" name="controller" value="ownservice" />
	<input type="hidden" name="boxchecked" value="0" />
	<input type="hidden" name="task" value="" />
	<input type="hidden" name="view" value="ownservice" />
	<input type="hidden" name="filter_order" value="<?php echo $this->lists['order']; ?>" />
	<input type="hidden" name="filter_order_Dir" value="<?php echo $this->lists['order_Dir']; ?>" />
	<?php echo JHTML::_( 'form.token' ); ?>
	</form>
 </div>
</div>